home *** CD-ROM | disk | FTP | other *** search
/ Compute! Gazette 1989 October / 1989-10.d64 / rgb demo (.txt) < prev    next >
Commodore BASIC  |  2022-09-20  |  4KB  |  106 lines

  1. 10 rem copyright 1989 compute! publications inc. - all rights reserved
  2. 20 ifok=0thenpoke55,0:poke56,80:clr
  3. 30 ifok=3then700
  4. 40 ifpeek(52033)=8thenok=1
  5. 50 ifok=0thenok=1:load"rgb kit",8,1
  6. 60 ifok=1thenok=2:sys52000
  7. 70 goto180
  8. 80 p=s+int(y/8)*320+int(x/8)*8+(yand7):pokep,peek(p)or2^(7-(xand7)):return
  9. 90 ifabs(x2-x1)>abs(y2-y1)then120
  10. 100 m=(x2-x1)/(y2-y1):gosub140:sp=(y1>y2or1):x=x1
  11. 110 fory=y1toy2stepsp:gosub80:x=x+m:nexty:return
  12. 120 m=(y2-y1)/(x2-x1):gosub140:sp=(x1>x2or1):y=y1
  13. 130 forx=x1tox2stepsp:gosub80:y=y+m:nextx:return
  14. 140 ifnot(((abs(m)<1)and(x1>x2))or((abs(m)>1)and(y1>y2)))thenreturn
  15. 150 x=x1:x1=x2:x2=x:y=y1:y1=y2:y2=y:return
  16. 160 u=1/((NULL)*rx):r1=ry*.72
  17. 170 fort=btoestepu:x=rx*cos(t)+x1:y=r1*sin(t)+y1:gosub80:nextt:return
  18. 180 print"[147]"tab(13)"rgb kit demo"
  19. 190 print"the  caps lock [146] key now toggles between"
  20. 200 print"the fast and slow modes. in the fast"
  21. 210 print"mode, the composite screen is blanked."
  22. 220 print"you must switch your monitor to rgb to"
  23. 230 print"see the screen. the commodore[146]+shift[146]"
  24. 240 print"key combination is still active in rgb"
  25. 250 print"mode."
  26. 260 print"switch your monitor to rgb mode and"
  27. 270 print"then press space[146] to cycle the character"
  28. 280 print"colors. press return[146] to continue":c=1
  29. 290 getk$:ifk$<>" "andk$<>chr$(13)then290
  30. 300 ifk$=" "thensys52006,c:c=(c+1)and15:goto290
  31. 310 print"[147]let's do a speed test. during the test,"
  32. 320 print"the screen fills with random characters."
  33. 330 print"use the caps lock[146] key to toggle"
  34. 340 print"between fast and slow modes. there is"
  35. 350 print"a marked difference in speed between"
  36. 360 print"the two modes. to exit the test press   return[146]."
  37. 370 getk$:ifk$=""then370
  38. 380 sys52009,5
  39. 390 print"[147]":z=1024
  40. 400 c=int(rnd(0)*256):pokez,c
  41. 410 getk$:ifk$=chr$(13)then440
  42. 420 z=z+1:ifz<2024then400
  43. 430 goto390
  44. 440 sys52009,20
  45. 450 print"[147]normally, the rgb screen displays the"
  46. 460 print"same thing as the composite screen."
  47. 470 print"it can display the contents of memory"
  48. 480 print"anywhere in the 64's address space."
  49. 490 print"just for fun, let's look at part of the"
  50. 500 print"ram used by the basic interpreter."
  51. 510 print"press return[146] to continue."
  52. 520 getk$:ifk$=""then520
  53. 530 sys52012,0:sys52009,5
  54. 540 getk$:ifk$<>chr$(13)then540
  55. 550 sys52012,1024:sys52009,20
  56. 560 print"[147]the 64 has two character sets which can"
  57. 570 print"be toggled in and out by pressing the"
  58. 580 print"commodore[146]+shift[146] keys. rgb kit also"
  59. 590 print"has two character sets. unlike the"
  60. 600 print"normal 64 character sets, rgb kit's sets"
  61. 610 print"can be changed very easily. this part"
  62. 620 print"of the demo loads a new character set"
  63. 630 print"which replaces the uppercase/lowercase"
  64. 640 print"set in rgb mode. press commodore[146]+shift[146]";
  65. 650 print"to toggle between the new set and the"
  66. 660 print"standard set. press return[146] to continue."
  67. 670 getk$:ifk$=""then670
  68. 680 print"[147]loading character set"
  69. 690 print"please wait...":ok=3:sys52003:load"chrset",8,1
  70. 700 sys52000:sys52015,40960,1:print"[147]           character set demo"
  71. 710 forz=0to255:poke1104+z,z:next
  72. 720 print"the quick brown fox jumped over":print"the lazy dog."
  73. 730 getk$:ifk$<>chr$(13)then730
  74. 740 sys52003:sys52000
  75. 750 print"[147]rgb kit's most spectacular ability is"
  76. 760 print"its ability to display hi-res screens."
  77. 770 print"a hi-res screen can be taken from any"
  78. 780 print"location in the 64's ram, including the"
  79. 790 print"ram under the basic rom, kernal rom and"
  80. 800 print"i/o space. press space[146] to generate and"
  81. 810 print"display a bitmap screen. press return[146]"
  82. 820 print"to exit the demo."
  83. 830 getk$:ifk$<>" "andk$<>chr$(13)then830
  84. 840 ifk$=chr$(13)then990
  85. 850 print"[147]please wait...drawing"
  86. 860 fori=0to35:reada:poke49152+i,a:nexti:sys49152:s=32768:c=31744
  87. 870 x1=150:y1=85:rx=75:ry=rx:b=0:e=2*(NULL):gosub160
  88. 880 x1=115:y1=70:rx=15:ry=rx:b=0:e=2*(NULL):gosub160
  89. 890 x1=185:y1=70:rx=15:ry=rx:b=0:e=2*(NULL):gosub160
  90. 900 x1=150:y1=90:rx=60:ry=50:b=10*(NULL)/180:e=170*(NULL)/180:gosub160
  91. 910 x1=150:y1=90:rx=63:ry=30:b=20*(NULL)/180:e=160*(NULL)/180:gosub160
  92. 920 x1=75:y1=150:x2=140:y2=162:gosub90:x1=140:y1=162:x2=160:y2=162:gosub90
  93. 930 x1=160:y1=162:x2=225:y2=150:gosub90:x1=225:y1=150:x2=225:y2=190:gosub90
  94. 940 x1=225:y1=190:x2=160:y2=178:gosub90:x1=160:y1=178:x2=140:y2=178:gosub90
  95. 950 x1=140:y1=178:x2=75:y2=190:gosub90:x1=75:y1=190:x2=75:y2=150:gosub90
  96. 960 x1=140:y1=162:x2=140:y2=178:gosub90:x1=160:y1=162:x2=160:y2=178:gosub90
  97. 970 sys52000:sys52018,s,c
  98. 980 getk$:ifk$<>chr$(13)then980
  99. 990 sys52000:print"[147]end of demo.":sys52003:end
  100. 1000 data 169,0,168,162,32,153
  101. 1010 data 0,128,200,208,250,238
  102. 1020 data 7,192,202,208,244,169
  103. 1030 data 48,160,0,162,4,153
  104. 1040 data 0,124,200,208,250,238
  105. 1050 data 25,192,202,208,244,96
  106.